E.g. (this might offend smokers lol)
Scenario 1
Let's say you are aware that smoking is bad for you and addictive (element 1) so you dont smoke (element 2) - this is congnitive consonance (rational harmony)
Scenario 2
Let's say you are aware that smoking is bad for you and addictive (element 1) but you smoke anyway (element 2) = the mind's natural reaction to this irrational decision is to create anxiety with the person smoking, but the person wanting to continue to smoke will substitute this anxiety with a positive mental idea "well him old so I will probably never get cancer" or "I will quit when I reach my 30's" this irrational excuse (element 3) will substitute element 1 - this is cognitive dissonance.